﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 流程控制_判断
{
    class Program
    {
        //单条件判断
        static void Main1(string[] args)
        {
            int a = 56;
            if (a >= 60)
            {
                Console.WriteLine("及格");
            }
            else
            {
                Console.WriteLine("不及格");
            }
        }

        //多条件判断
        static void Main2(string[] args)
        {

            Console.WriteLine("请输入成绩");
            int score = int.Parse(Console.ReadLine());
            if (score >= 90)
            {
                Console.WriteLine("优秀");
            }
            else if (score >= 70)
            {
                Console.WriteLine("良好");
            }
            else if (score >= 60)
            {
                Console.WriteLine("及格");
            }
            else
            {
                Console.WriteLine("不及格");
            }
        }

        static void Main(string[] args)
        {
            Random ran = new Random();
            int num = ran.Next(1, 101);

            
            while (true)
            {
                Console.WriteLine("请输入数字");
                int input = int.Parse(Console.ReadLine());
                if (input > num)
                {
                    Console.WriteLine("大了");
                }
                else if (input < num)
                {
                    Console.WriteLine("小了");
                }
                else
                {
                    Console.WriteLine("猜对了");
                    break;
                }
            }
        }
    }
}
